#!coding:utf-8
from rest_framework.response import Response
from rest_framework.generics import GenericAPIView

from django.contrib import auth
from django.contrib.auth.models import User

class LogoutView(GenericAPIView):
    model = User

    def get(self, request, *args, **kwargs):

        if request.user.is_authenticated():
            auth.logout(request)

        return Response({'user': None})